package com.ds.infrastructure.hyperspace.console.utils;

import org.apache.http.client.fluent.Request;

/**
 * @Author: yaozh
 * @Description:
 */
public class HttpUtil {
    private HttpUtil() {
    }

    public static Request getRequest(String url) {
        return getRequest(url, 2000, 10000);
    }

    public static Request getRequest(String url, int connectTimeout, int socketTimeout) {
        return Request.Get(url).connectTimeout(connectTimeout).socketTimeout(socketTimeout);
    }

    public static Request postRequest(String url) {
        return postRequest(url, 2000, 10000);
    }

    public static Request postRequest(String url, int connectTimeout, int socketTimeout) {
        return Request.Post(url).connectTimeout(connectTimeout).socketTimeout(socketTimeout);
    }
}
